-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get true dimensions for image metadata #17264
Conversation
import views.support.Item700 | ||
|
||
object Image { | ||
|
||
def apply(picture: ImageElement): JsValue = { | ||
val asset: Option[ImageAsset] = Item700.bestFor(picture.images) | ||
val url = Item700.bestSrcFor(picture.images).getOrElse("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to define these here to make the compiler happy 😨
PRbuilds results: Screenshots Exceptions (0) A11y validation (0) Apache Benchmark Load Testing --automated message |
Actually it looks like I need to take the minimum of the original asset dimension and the (attempted) resize by imgix. Imgix won't resize to any larger than the original dimensions as far as I can tell. cc: @paperboyo does that sound right? |
Yep, that’s right ( |
Thanks for people's time looking at this for me, but I'm taking the pragmatic decision and leaving this unchanged for now. I've fixed up the logic to be closer to the true behaviour, but until someone can prove this metadata actually affects anything I don't want to introduce this unnecessary complexity to the codebase. N.B. I still don't think my most recent attempt is quite right because it assumes |
What does this change?
Image metadata dimensions were based on the base image asset dimensions, but really should have been the true image dimensions that we actually serve after resizing. Tidy up after #17258
What is the value of this and can you measure success?
Image metadata dimensions are accurate. I don't know whether this has much effect, because I'm not sure how much these numbers are used by search engines etc.
Does this affect other platforms - Amp, Apps, etc?
Yes
Screenshots
Tested in CODE?
No